﻿<local:DocumentBase x:Class="WPFExcelReport.FLTORDNETWORK"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
       Height="700" Width="1024" 
       Background="White" 
         Loaded="Window_Loaded"
        Title="FLTORDNETWORK"  
     >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" Height="630" Width="978">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Vertical" Margin="0,0,3,21">
            <WrapPanel Width="968" Height="38">
                <Label Content="Sales order："    Width="117" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtORDER" Width="83" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="1"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Beige" MaxLength="6" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="Article："    Width="73" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtARTICLE" Width="162" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="2"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" Background="Pink" MaxLength="24" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="Customer code："    Width="139" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtCUSTOMER" Width="102" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="3"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" Background="Beige" MaxLength="8" FontSize="18" Foreground="#FF141111" Height="33" />

            </WrapPanel>
            <WrapPanel Name="ZoneOrder" Height="37">
                <Label Content="Delivery Date:" Height="26" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label1" VerticalAlignment="Top" Width="131" FontSize="18" />
                <DatePicker Height="29" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="109" />
                <Label Content="-" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label2" VerticalAlignment="Top" Width="19" FontSize="18" />
                <DatePicker Height="29" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="109" />
                <Button Height="30" Margin="20,0,0,0"  Name="btnQuery" Width="30" Panel.ZIndex="2"
                        Click="btnQuery_Click">
                     <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Button   Height="33" Margin="20,0,0,0"  Name="btnPrintPreview" Width="30" Click="btnPrintPreview_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/excel_icon.jpg" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </StackPanel>
        <StackPanel Margin="0,75,3,12" Grid.RowSpan="4" Grid.ColumnSpan="2">            
            <WrapPanel Width="972" Height="538">
                <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  Width="969"
                  Height="522"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.RowSpan="3" Grid.Row="1" DataContext="{Binding}">
                    <!--DD	DELDATEF	DELDATE	ORDERDATE	CUSTOMER	ORDERNO	ITEM	ENTERUSER	
                    ARTICLE	COLOR	ORDQTY	ALLQTY	SHIPQTY	ORDNO2	ALLQTY2	ALLDATE2	FINISHQTY2	
                    PFDATE2	ORDSTATUS2	FDATE2	ORDNO1	ALLQTY1	ALLDATE1	FINISHQTY1	PFDATE1	ORDSTATUS1	
                    FDATE1	RECSTATUS1	RECDATE1	RECQTY1--> 
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=DD}" Header="Remain Days" Width="SizeToHeader" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=DELDATE}" Header="Delivery Date" Width="SizeToHeader" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=ORDERDATE}" Header="Order Date" Width="SizeToHeader" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="Customer" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDERNO}" Header="Order#" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=ITEM}" Header="Pos" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=ENTERUSER}" Header="Merchandiser" Width="SizeToHeader" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="Article" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="Color" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDQTY}" Header="Order QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ALLQTY}" Header="Allocate QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=SHIPQTY}" Header="Shipping QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDNO2}" Header="Production NO" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ALLQTY2}" Header="Raw-material QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=SPDATE2}" Header="Plan Started Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ALLDATE2}" Header="Real Started Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PFDATE2}" Header="Plan Delivery Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDSTATUS2}" Header="Status" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=FDATE2}" Header="Finished Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=FINISHQTY2}" Header="Produced QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDNO1}" Header="Finised Order" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ALLQTY1}" Header="Raw-material QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=SPDATE1}" Header="Plan Started Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ALLDATE1}" Header="Real Started Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PFDATE1}" Header="Plan Delivery Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=RECSTATUS1}" Header="Recived status" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=RECDATE1}" Header="Recived Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=RECQTY1}" Header="Received QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDSTATUS1}" Header="Status" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=FDATE1}" Header="In stock Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=FINISHQTY1}" Header="In stock QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="Delay Reason" Width="SizeToCells" MinWidth="40" />
                        
                    </DataGrid.Columns>
                </DataGrid>
            </WrapPanel>
        </StackPanel>
       
    </Grid>
</local:DocumentBase>
